
import { Department } from './Department';
import { User } from './User';
import {AssetType} from './AssetType';

export interface Asset {
  id?: string;
  assetBrand?: string;
  assetDepartmentId?: string;
  assetCode?: string;
  sysDepartment?: Department;
  sysUser?: User;
  assetImgUrl1?: string;
  assetImgUrl2?: string;
  assetImgUrl3?: string;
  assetName?: string;
  assetNum?: number;
  assetPrice?: number;
  assetStatus?: AssetStatus;
  assetType?: string;
  assetUserId?: string;
  assetVersion?: string;
  qrcodeUrl?: string;
  buyDate?: any;
  buyDateShow?: any;
  createDate?: Date;
  updateDate?: Date;
  remark?: string;
  oaAssetType?: AssetType;
  assetImg?: string;
  position?: string;
}

export enum AssetStatus {
  IDLE = 0,
  USE = 1,
  BROKE = 2,
  MEND = 3,
  ABANDONED = 4
}

export const assetStatus = [AssetStatus.IDLE, AssetStatus.USE, AssetStatus.BROKE, AssetStatus.MEND, AssetStatus.ABANDONED];

export const StatusNameMap = {
  [AssetStatus.IDLE]: '闲置',
  [AssetStatus.USE]: '使用中',
  [AssetStatus.BROKE]: '报修',
  [AssetStatus.MEND]: '修理中',
  [AssetStatus.ABANDONED]: '报废'
};

export enum  SearchType {
  ASSETNAME = 0,
  ASSETUSER = 1,
  ASSETDEPARTMENT = 2,
  REMARK = 3,
  ALL = 4,
  ASSETTYPE = 5
}

export  const SearchTypeMap = ['资产名称', '资产使用人', '部门', '', '全部', '设备类型'];
